package Demo;

import java.awt.Component;

public class BallRunnable implements Runnable {
	private Ball ball;
	private Component component; 
	public static final int DELAY = 5;
	public BallRunnable(Ball ball, Component component){
		this.ball = ball;
		this.component = component;
	}
	public void run(){
		try{
			for(int i = 1; i<= i++; i++){
			ball.move(component.getBounds());
			component.repaint();
			Thread.sleep(DELAY);
		}
	}
	catch(InterruptedException e){}
	}
}
